<template>
	<view>
		<view class="search_flex">
			<view class="search">
				<image class="ico" src="@/static/ico_ss.png" mode="widthFix"></image>
				<input class="input" placeholder-class="placeholder" v-model="keyword" type="text"
					placeholder="搜索班级名称/课程名称" />
			</view>
			<view class="btn_screen" @click="openScreen">
				<image class="ico" src="@/static/ico_s1.png" mode="widthFix"></image>
				<view class="text">筛选</view>
			</view>
		</view>

		<view class="clue_list">
			<view class="item">
				<image class="ph" src="@/static/ico_head.png" mode="aspectFill"></image>
				<view class="info">
					<view class="title">
						<view class="name">
							施涵涵
						</view>
					</view>
					<view class="source">
						08.10喜悦大教室课程
						<view class="tag">
							一对多
						</view>
					</view>
					<view class="time">
						喜悦大教室2班
					</view>
				</view>
				<view class="state">
					剩余课时：<text class="red">7</text>
				</view>
			</view>
			<view class="item">
				<image class="ph" src="../../static/ico_head.png" mode="aspectFill"></image>
				<view class="info">
					<view class="title">
						<view class="name">
							施涵涵
						</view>
					</view>
					<view class="source">
						08.10喜悦大教室课程
						<view class="tag">
							一对多
						</view>
					</view>
					<view class="time">
						喜悦大教室2班
					</view>
				</view>
				<view class="state">
					剩余课时：<text class="red">7</text>
				</view>
			</view>
		</view>

		<uv-popup ref="popup" mode="right" :safeAreaInsetBottom="true" @change="changeScreen">
			<view class="screen_popup">
				<view class="title">
					筛选
				</view>
				<view class="screen_list">
					<view class="screen_item">
						<view class="name">
							课程类型
						</view>
						<view class="select">
							<view class="item" v-for="(item,index) in status" :class="statusIndex == index?'hover':''"
								:key="index" @click="clickStatus(index)">
								{{item}}
							</view>
						</view>
					</view>
					<view class="screen_item2" @click="openPicker">
						<view class="name">
							课程
						</view>
						<view class="picker">
							<text>请选择</text>
							<uv-icon name="arrow-right" color="#BEBEBE" size="24rpx"></uv-icon>
						</view>
					</view>
					<view class="screen_item2" @click="openPicker">
						<view class="name">
							班级
						</view>
						<view class="picker">
							<text>请选择</text>
							<uv-icon name="arrow-right" color="#BEBEBE" size="24rpx"></uv-icon>
						</view>
					</view>
					<view class="screen_item2" @click="openPicker">
						<view class="name">
							老师
						</view>
						<view class="picker">
							<text>请选择</text>
							<uv-icon name="arrow-right" color="#BEBEBE" size="24rpx"></uv-icon>
						</view>
					</view>
				</view>
				<view class="screen_btn">
					<view class="btn_white">
						重置
					</view>
					<view class="btn_org">
						确定
					</view>
				</view>
			</view>
		</uv-popup>

		<uv-picker ref="picker" :columns="columnsPicker" @confirm="confirmPicker"></uv-picker>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				keyword: '',
				status: ['一对一', '一对多'],
				columnsPicker: [
					['数据1', '数据2', '数据3']
				],
				statusIndex: -1
			}
		},
		onLoad() {

		},
		methods: {
			clickStatus(index) {
				this.statusIndex = index
			},
			closeCancel() {
				this.$refs.popupCancel.close();
			},
			openCancel() {
				this.$refs.popupCancel.open();
			},
			clickDel() {
				uni.showModal({
					title: '确定要删除跟进？',
					content: '删除后跟进记录将无法恢复',
					confirmColor: '#FF8535',
					success: function(res) {
						if (res.confirm) {
							console.log('用户点击确定');
						} else if (res.cancel) {
							console.log('用户点击取消');
						}
					}
				});
			},
			openInfo() {
				this.$refs.popupInfo.open();
			},
			closeInfo() {
				this.$refs.popupInfo.close();
			},
			changePopupInfo(e) {
				console.log('弹窗状态改变：', e);
			},
			openRangeTime() {
				this.$refs.calendars.open();
			},
			confirmRangeTime(e) {
				console.log(e.range.before)
				console.log(e.range.after)
				this.startTime = e.range.before
				this.endTime = e.range.after
			},
			gotoInfo() {
				uni.navigateTo({
					url: '/pages/clueInfo/clueInfo'
				});
			},
			openPicker() {
				this.$refs.picker.open();
			},
			confirmPicker() {

			},
			openScreen() {
				this.$refs.popup.open();
			},
			changeScreen(e) {
				console.log('弹窗状态改变：', e);
			}
		}
	}
</script>

<style lang="scss" scoped>
	.red {
		color: #FA5151;
	}

	.org {
		color: #FF8535;
	}

	.blue {
		color: #3378F5;
	}

	.gray {
		color: rgba(61, 61, 61, 0.4);
	}

	.green {
		color: rgba(0, 181, 120, 1);
	}

	.trail_info {
		color: #3D3D3D;

		.textarea {
			padding: 10rpx 25rpx;
			background: #fff;
		}

		.info {
			padding: 20rpx 40rpx;

			.item {
				display: flex;
				justify-content: space-between;
				padding: 6rpx 0;

				.name {
					flex-shrink: 0;
					font-size: 24rpx;
					font-weight: 500;
					line-height: 40rpx;
					width: 130rpx;
				}

				.text {
					width: 100%;
					font-size: 24rpx;
					font-weight: normal;
					line-height: 40rpx;
				}
			}
		}

		.btn2 {
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 0 30rpx 40rpx;

			.btn_white {
				width: 330rpx;
				height: 84rpx;
				border-radius: 8rpx;
				background: #FFFFFF;
				box-sizing: border-box;
				border: 2rpx solid #FF8535;
				line-height: 84rpx;
				text-align: center;
				font-size: 28rpx;
				color: #FF8535;
			}

			.btn_org {
				width: 330rpx;
				height: 84rpx;
				border-radius: 8rpx;
				background: #FF8535;
				box-sizing: border-box;
				border: 2rpx solid #FF8535;
				line-height: 84rpx;
				text-align: center;
				font-size: 28rpx;
				color: #fff;
			}
		}

		.btn_del {
			padding: 40rpx 0;
			text-align: center;
			font-size: 28rpx;
			font-weight: normal;
			line-height: 38rpx;
			color: #FF8535;
		}

		.title {
			padding: 0 35rpx 0 40rpx;
			line-height: 110rpx;
			font-size: 28rpx;
			border-bottom: 2rpx solid rgba(230, 229, 231, 0.8);
			display: flex;
			align-items: center;
			justify-content: space-between;
		}

		.user {
			padding: 20rpx 40rpx;
			border-bottom: 2rpx solid rgba(230, 229, 231, 0.8);
			position: relative;

			.name {
				font-size: 28rpx;
				font-weight: normal;
				line-height: 30rpx;
			}

			.phone {
				margin-top: 20rpx;
				font-size: 24rpx;
				font-weight: normal;
				line-height: 24rpx;
			}

			.ico {
				position: absolute;
				right: 33rpx;
				top: 50%;
				margin-top: -15rpx;
			}
		}
	}

	.follow_time {
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin-top: 20rpx;

		.ico {
			flex-shrink: 0;
			line-height: 30rpx;
			font-size: 30rpx;
			padding: 0 20rpx;
		}

		.input {
			width: 100%;
			height: 56rpx;
			line-height: 56rpx;
			background: #F7F8FA;
			text-align: center;
			font-size: 24rpx;
			color: rgba(61, 61, 61, 0.8);
			border-radius: 7rpx;
		}
	}

	.screen_popup {
		position: relative;
		width: 650rpx;
		height: 100%;
		background: #F7F8FA;

		.title {
			text-align: center;
			background: #fff;
			font-size: 30rpx;
			color: #3D3D3D;
			line-height: 40rpx;
			padding: 20rpx;
		}

		.screen_list {
			background: #fff;
			padding: 0 0 0;
		}

		.screen_item2 {
			padding: 40rpx 36rpx;
			border-bottom: 1px solid rgba(230, 229, 231, 0.8);
			display: flex;
			align-items: center;
			justify-content: space-between;

			.picker {
				display: flex;
				align-items: center;
				color: #BEBEBE;
				font-size: 30rpx;
				line-height: 42rpx;

				text {
					padding-right: 8rpx;
				}
			}
		}

		.screen_item {
			padding: 40rpx 36rpx;
			border-bottom: 1px solid rgba(230, 229, 231, 0.8);

			.select {
				display: flex;
				align-items: center;
				flex-wrap: wrap;

				.item {
					width: 170rpx;
					height: 56rpx;
					line-height: 56rpx;
					background: #F7F8FA;
					text-align: center;
					font-size: 24rpx;
					margin-top: 20rpx;
					color: rgba(61, 61, 61, 0.8);
					border-radius: 7rpx;
					margin-right: 20rpx;

					&.hover {
						color: #fff;
						background: #FF8535;
					}
				}
			}

			.name {
				flex-shrink: 0;
				font-size: 30rpx;
				color: #3D3D3D;
				line-height: 42rpx;
			}

			.picker {
				display: flex;
				align-items: center;
				color: #BEBEBE;
				font-size: 30rpx;
				line-height: 42rpx;

				text {
					padding-right: 8rpx;
				}
			}
		}

		.screen_btn {
			position: absolute;
			left: 0;
			right: 0;
			bottom: 0;
			padding: 15rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;

			.btn_white {
				width: 300rpx;
				height: 84rpx;
				line-height: 84rpx;
				text-align: center;
				background: #FFFFFF;
				box-sizing: border-box;
				border: 2rpx solid #FF8535;
				font-size: 28rpx;
				color: #FF8535;
			}

			.btn_org {
				width: 300rpx;
				height: 84rpx;
				line-height: 84rpx;
				text-align: center;
				background: #FF8535;
				color: #fff;
				font-size: 28rpx;
			}
		}
	}

	.ico_add {
		position: fixed;
		right: 40rpx;
		bottom: 180rpx;
		border-radius: 50%;
		width: 100rpx;
		height: 100rpx;
		box-shadow: 0 5rpx 15rpx rgba(0, 0, 0, 0.2);
	}

	.clue_list {
		background: #fff;

		.item {
			display: flex;
			justify-content: space-between;
			padding: 30rpx 60rpx 30rpx 40rpx;
			border-bottom: 1px solid rgba(230, 229, 231, 0.8);
			position: relative;

			.info {
				width: 100%;

				.title {
					display: flex;
					align-items: center;
					padding: 4rpx 0;

					.name {
						font-size: 30rpx;
						font-weight: 500;
						line-height: 30rpx;
						color: #3D3D3D;
					}

					.tag_red {
						display: block;
						flex-shrink: 0;
						width: 30rpx;
						height: 30rpx;
						border-radius: 8rpx;
						background: rgba(255, 215, 237, 0.8);
						font-size: 20rpx;
						line-height: 30rpx;
						text-align: center;
						color: #FA5151;
						margin-left: 20rpx;
					}

					.tag_yellow {
						display: block;
						flex-shrink: 0;
						width: 30rpx;
						height: 30rpx;
						border-radius: 8rpx;
						background: #FFF8C6;
						font-size: 20rpx;
						line-height: 30rpx;
						text-align: center;
						color: #FF8F1F;
						margin-left: 20rpx;
					}

					.tag_gray {
						display: block;
						flex-shrink: 0;
						width: 30rpx;
						height: 30rpx;
						border-radius: 8rpx;
						background: rgba(230, 229, 231, 0.698);
						font-size: 20rpx;
						line-height: 30rpx;
						text-align: center;
						color: rgba(154, 154, 154, 1);
						margin-left: 20rpx;
					}
				}

				.source {
					padding-top: 8rpx;
					font-size: 24rpx;
					font-weight: normal;
					line-height: 42rpx;
					color: rgba(61, 61, 61, 0.6);
					display: flex;
					align-items: center;

					.tag {
						flex-shrink: 0;
						padding: 0 10rpx;
						border-radius: 6rpx;
						border: 2rpx solid #FF8535;
						font-size: 20rpx;
						line-height: 30rpx;
						text-align: center;
						color: #FF8535;
						margin-left: 20rpx;
					}
				}

				.time {
					font-size: 24rpx;
					font-weight: normal;
					line-height: 38rpx;
					color: rgba(61, 61, 61, 0.6);
				}
			}

			.ph {
				flex-shrink: 0;
				width: 100rpx;
				height: 100rpx;
				margin-right: 25rpx;
			}

			.state {
				position: absolute;
				top: 50%;
				right: 40rpx;
				color: #333;
				flex-shrink: 0;
				font-size: 24rpx;
				line-height: 40rpx;
				margin-top: -20rpx;
			}
		}
	}

	.search_flex {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 20rpx 40rpx;
		border-bottom: 1px solid rgba(230, 229, 231, 0.8);
		background: #fff;

		.search {
			width: 100%;
			height: 80rpx;
			background: #F7F7F9;
			display: flex;
			align-items: center;
			border-radius: 16rpx;
			padding: 0 20rpx;

			.ico {
				flex-shrink: 0;
				width: 40rpx;
				height: 40rpx;
				margin-right: 15rpx;
				opacity: 0.8;
			}

			.input {
				display: block;
				width: 100%;
				background: none;
				border: none;
				font-size: 28rpx;
				color: #333;
				height: 40rpx;
				line-height: 40rpx;
			}

			.placeholder {
				color: #BEBEBE;
			}
		}

		.btn_screen {
			flex-shrink: 0;
			display: flex;
			align-items: center;
			padding: 0 8rpx;
			margin-left: 20rpx;

			.ico {
				flex-shrink: 0;
				width: 30rpx;
				height: 32rpx;
				margin-right: 10rpx;
			}

			.text {
				color: #3D3D3D;
				font-size: 28rpx;
			}
		}
	}
</style>